package com.code.app.entities;

import android.os.Parcel;
import android.os.Parcelable;

public class DownLoadInfo implements Parcelable {

    private String name;

    private int id;

    private int progress;

    private String url;

    private String descroption;

    private DownLoadState downLoadState = DownLoadState.STOP;

    public enum DownLoadState {

        STOP(0), START(1);

        int code;

        DownLoadState(int code) {
            this.code = code;
        }

        public int getCode() {
            return code;
        }
    }

    public DownLoadInfo() {
    }

    public DownLoadInfo(String name, int id, int progress, String url, String descroption) {
        this.name = name;
        this.id = id;
        this.progress = progress;
        this.url = url;
        this.descroption = descroption;
    }

    public DownLoadState getDownLoadState() {
        return downLoadState;
    }

    public void setDownLoadState(DownLoadState downLoadState) {
        this.downLoadState = downLoadState;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getProgress() {
        return progress;
    }

    public void setProgress(int progress) {
        this.progress = progress;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getDescroption() {
        return descroption;
    }

    public void setDescroption(String descroption) {
        this.descroption = descroption;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(name);
        dest.writeInt(id);
        dest.writeInt(progress);
        dest.writeString(url);
        dest.writeString(descroption);
    }

    protected DownLoadInfo(Parcel in) {
        name = in.readString();
        id = in.readInt();
        progress = in.readInt();
        url = in.readString();
        descroption = in.readString();
    }

    public static final Creator<DownLoadInfo> CREATOR = new Creator<DownLoadInfo>() {
        @Override
        public DownLoadInfo createFromParcel(Parcel in) {
            return new DownLoadInfo(in);
        }

        @Override
        public DownLoadInfo[] newArray(int size) {
            return new DownLoadInfo[size];
        }
    };

}
